package com.educationx;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Comment {
	private String text;
	private String date;
	private String rate;
	private String username;
	
	public Comment(String text, String date, String username) {
		SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy");
		SimpleDateFormat commentDateFormat = new SimpleDateFormat("HH:mm:ss d MMM  yyyy");
		Date tempDate = new Date();
		try {
			tempDate = dateFormat.parse(date);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		this.text = text;
		this.date = commentDateFormat.format(tempDate).toString();
		this.username = username;
	}
	
	public String getText() {
		return text;
	}
	
	public void setText(String text) {
		this.text = text;
	}
	
	public String getDate() {
		return date;
	}
	
	public void setDate(String date) {
		this.date = date;
	}
	
	public String getRate() {
		return rate;
	}
	
	public void setRate(String rate) {
		this.rate = rate;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
}
